1. Field of the Invention
The present invention relates to a medium-edge setting device for setting edge positions of a paper and an image forming apparatus, such as a photocopier, printer, or the like employing the medium-edge setting device.
2. Description of Related Art
A medium-edge setting device for detecting both side edge positions of a medium such as that disclosed in Japanese Patent No. 2907597 is well known in the art. This medium-edge setting device includes an optical sensor having a light-emitting unit (light-emitting element) and a light-receiving unit (light-receiving element) and detects both side edges of a medium while the optical sensor moves reciprocally in the widthwise direction of the medium.
In this medium-edge setting device, the optical sensor is mounted on a carriage that travels reciprocally in the widthwise direction of the medium. In order to detect the edge positions of the medium, the optical sensor samples the amount of light reflected from the medium while the carriage moves from one edge of the medium to the other. A threshold value for determining the existence of the medium is set based on the difference in output from the optical sensor at a position in which the medium is present and a position in which the medium is not present. The optical sensor again detects the amount of light reflected from the medium as the carriage returns in the opposite direction, and both side edges of the medium are detected by comparing the amount of reflected light detected by the optical sensor with the threshold value set above. In this way, the medium-edge setting device detects the edge positions of a medium.
However, the medium-edge setting device described above sets a single threshold value based on amounts of reflected light sampled by the optical sensor and uses this single threshold value for detecting both the left edge and the right edge. Accordingly, when the left and right edges of a medium have different shades of color or reflectance due to soiled or yellowed areas on the medium, for example, or when the medium has been preprinted with characters or images, the medium-edge setting device described above is susceptible to errors in detecting the left and right edges and may have difficulty detecting the edge positions with accuracy.
Another example is disclosed in Japanese patent application publication No. HEI-3-7371. An optical sensor is mounted on the carriage of an image forming apparatus. As the carriage is moved from one widthwise side of the paper to the other, the optical sensor irradiates light onto the paper and detects the amount of light reflected therefrom in order to detect the edges of the paper.